﻿using UnityEngine;
using System.Collections;

namespace DragonRescue3D
{
    /// <summary>
    /// Class defining behaviour for the placeholders representing cells in the 
    /// Level's Block Grid
    /// </summary>
    [ExecuteInEditMode]
    public class PlaceHolder : MonoBehaviour
    {
        //--------------------------------------------------------
        /// <summary>
        /// Sets a flag on start-up in order to prevent the placeholder from
        /// being accidentally deleted.
        /// NOTE:  in order to unset this simply change the flag to be 
        /// gameObject.hideFlags = HideFlags.None 
        /// </summary>
        void Start()
        {
            gameObject.hideFlags |= HideFlags.NotEditable;
        }

        //--------------------------------------------------------
        /// <summary>
        /// Draws the placeholder icon at the grid cell location when in edit mode
        /// </summary>
        void OnDrawGizmos()
        {
            Gizmos.DrawIcon(transform.position, "PlaceholderGizmo.png", true);
        }

        //--------------------------------------------------------
        /// <summary>
        /// Retrieves all child grid objects for the palceholder
        /// </summary>
        /// <returns>Array containing the child objects</returns>
        public GridObject[] GetChildGridObjects()
        {
            return GetComponentsInChildren<GridObject>();
        }
    }
}

#if NO_AND_ERROR
public void TEXT1() 
{
	int textNum = 1;
	if (textNum == 1) 
	{
		textNum = 2;
    }
}
public void TEXT2()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}
public void TEXT3()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT4()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT5()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT6()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT8()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT9()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT10()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT11()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT12()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT13()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT14()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT15()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT16()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}

public void TEXT17()
{
    int textNum = 1;
    if (textNum == 1)
    {
        textNum = 2;
    }
}
#endif